import { createRouter, createWebHistory, RouterLink } from 'vue-router'
import Home from './components/Home.vue'
import Movie from './components/Movie.vue'
import About from './components/About.vue'
import HelloWorld from './components/HelloWorld.vue'
import Login from './components/Login.vue'
import Notfound from './components/Notfound.vue'

const router = createRouter({
    history: createWebHistory(),
    routes: [
        {
            path: '/',
            component: HelloWorld
        },
        {
            path: '/login',
            component: Login
        },
        {
            path: '/home/:id',
            name:'Home-F',
            component: Home,
            children: [
                {
                    path:'',
                    name:'blank',
                    component:()=>import('./components/HomeUser.vue')
                },
                {
                    path: 'profile',
                    name:'ProfileZ',
                    component: () => import('./components/HomeProfile.vue')
                }, {
                    path: 'login',
                    name:'LoginZ',
                    component: () => import('./components/HomeLogin.vue')
                }
            ]
        },
        {
            path: '/movie',
            component: Movie
        },
        {
            path: '/about',
            component: About
        },
        // { path: '/:pathMatch(.*)*', component: ()=>import('./components/Notfound.vue') }
    ]

})
router.beforeEach((to, from) => {
    console.log(to);
    console.log(from);
    // next()
})


export default router